package com.push.web.controller;

import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.push.common.annotation.Log;
import com.push.common.core.controller.BaseController;
import com.push.common.core.domain.AjaxResult;
import com.push.common.enums.BusinessType;
import com.push.web.domain.BizMultimodalFile;
import com.push.web.service.IBizMultimodalFileService;
import com.push.common.utils.poi.ExcelUtil;
import com.push.common.core.page.TableDataInfo;

/**
 * 多模态数据Controller
 *
 * @author bguan
 * @date 2024-04-09
 */
@RestController
@RequestMapping("/information/multimodal_file")
public class BizMultimodalFileController extends BaseController
{
    @Autowired
    private IBizMultimodalFileService bizMultimodalFileService;

    /**
     * 查询多模态数据列表
     */
    @PreAuthorize("@ss.hasPermi('information:multimodal_file:list')")
    @GetMapping("/list")
    public TableDataInfo list(BizMultimodalFile bizMultimodalFile)
    {
        startPage();
        List<BizMultimodalFile> list = bizMultimodalFileService.selectBizMultimodalFileList(bizMultimodalFile);
        return getDataTable(list);
    }

    /**
     * 导出多模态数据列表
     */
    @PreAuthorize("@ss.hasPermi('information:multimodal_file:export')")
    @Log(title = "多模态数据", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(BizMultimodalFile bizMultimodalFile)
    {
        List<BizMultimodalFile> list = bizMultimodalFileService.selectBizMultimodalFileList(bizMultimodalFile);
        ExcelUtil<BizMultimodalFile> util = new ExcelUtil<BizMultimodalFile>(BizMultimodalFile.class);
        return util.exportExcel(list, "多模态数据数据");
    }

    /**
     * 获取多模态数据详细信息
     */
    @PreAuthorize("@ss.hasPermi('information:multimodal_file:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(bizMultimodalFileService.selectBizMultimodalFileById(id));
    }

    /**
     * 新增多模态数据
     */
    @PreAuthorize("@ss.hasPermi('information:multimodal_file:add')")
    @Log(title = "多模态数据", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody BizMultimodalFile bizMultimodalFile)
    {
        return toAjax(bizMultimodalFileService.insertBizMultimodalFile(bizMultimodalFile));
    }

    /**
     * 修改多模态数据
     */
    @PreAuthorize("@ss.hasPermi('information:multimodal_file:edit')")
    @Log(title = "多模态数据", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody BizMultimodalFile bizMultimodalFile)
    {
        return toAjax(bizMultimodalFileService.updateBizMultimodalFile(bizMultimodalFile));
    }

    /**
     * 删除多模态数据
     */
    @PreAuthorize("@ss.hasPermi('information:multimodal_file:remove')")
    @Log(title = "多模态数据", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(bizMultimodalFileService.deleteBizMultimodalFileByIds(ids));
    }
}
